<extend name="Public/base" />

<!-- 子導航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>

<block name="body">
 
<script type="text/javascript" src="__ROOT__/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__ROOT__/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="__ROOT__/Addons/UploadImages/style/UploadImages.css">
<style>
 .tags{ margin-bottom: 2px;width:80px; font-size:10px; height: 25px; border-radius: 3px; color:#fff; text-align:center; position:relative; float: left; margin-right: 5px; line-height: 25px}
.shut{ position:absolute; top: 0; right: 2px; font-size:10px;padding-TOP:6px; line-height: 0; font-size: 2px; color: #fff }
.c1{ background:#ec5e5e}
.c2{ background:#5ac991}
.c3{ background:#ff9999}
.shake{ animation:one 0.2s infinite; -webkit-animation:one 0.2s infinite; }
@keyframes one{
	0%{ transform:rotate(10deg);
	-webkit-transform:rotate(10deg);}
	50%{ transform:rotate(-10deg);
	-webkit-transform:rotate(-10deg);}
	100%{ transform:rotate(10deg);-webkit-transform:rotate(10deg);}
	}

@-webkit-keyframes one{
	0%{ transform:rotate(3deg);
	-webkit-transform:rotate(3deg);}
	50%{ transform:rotate(-3deg);
	-webkit-transform:rotate(-3deg);}
	100%{ transform:rotate(4deg);-webkit-transform:rotate(3deg);}
	}
</style> 
	<div class="main-title cf">
		<h2>
			基本資料 
		</h2>
	</div>
	<!-- 標簽頁導航 -->
<div class="tab-wrap">
<!--	<ul class="tab-nav nav">
		<volist name=":parse_config_attr($model['field_group'])" id="group">
			<li data-tab="tab{$key}" <eq name="key" value="1">class="current"</eq>><a href="javascript:void(0);">{$group}</a></li>
		</volist>
	</ul>-->
	<div class="tab-content">
	<!-- 表單 -->
	<form id="form" action="{:U('update')}" method="post" class="form-horizontal">
		<!-- 基礎文檔模型 -->
                <input type="text" value="2" name="type"  style="display: none">
                      <input type="text" value="0" name="cover_id" style="display: none">
                          <input type="text" value="0" name="link_id" style="display: none"> 

               <div class="form-item cf">
                    <label class="item-label">物業名稱<span class="check-tips">（標題）</span></label>
                    <div class="controls">
                        <input  type="text" class="text input-6x" name="title" value="{$data.title}" >                    </div>
                </div>
                  <div class="form-item cf">
                    <label class="item-label">副標題<span class="check-tips"></span></label>
                    <div class="controls">
                        <input  type="text" class="text input-6x" name="title2" value="{$data.title2}" >                    </div>
                </div>
                         <div class="form-item cf">
                    <label class="item-label">標籤<span class="check-tips">（點擊標籤列表即可添加）</span></label>
                    <div class="controls">
                        <input id="tags" type="text" class="text input-6x" name="tag" value="{$data.tag}" style="display:none">
                        <div class="tagbox">
                         
                          <!--動態添加標籤-->
                        </div>
                    </div>   
                </div>
                    
                 <div class="form-item cf">
                    
                    <div class="controls">
                        <input class="tagtxt" type="text" class="text input-2x " name="come" > <a class='tagmake' style="color:blue" href="#">[+]創建標籤</a>  <a href="#" class="tagmag" style="color:red">[-]管理標籤</a>                  </div>
                     <p id='tag'></p> 
                </div>
       <div class="form-item cf">
                     <label class="item-label">所在地<span class="check-tips"></span></label> 
                    <div class="controls">
                          <select name='add'>
                            <option>所在地</option>
                            <volist name="add" id="vo">
                              <option>{$vo}</option>   
                            </volist>
                        </select>                
                    </div>
                </div>
                                 <div class="form-item cf">
                     <label class="item-label">房屋類型<span class="check-tips"></span></label> 
                    <div class="controls">
                          <select name='housestype'>
                            <option>房屋類型</option>
                            <volist name="type" id="vo">
                              <option>{$vo}</option>   
                            </volist>
                        </select>                
                    </div>
                </div>
                   <div class="form-item cf">
                    <label class="item-label">銷售類型<span class="check-tips"></span></label>
                   <div class="controls">
                        <label>
                                    <input class="radios" type="radio" value="0" name="sell" data-check="{$data.sell}">出售                                	</label><label >
                                    <input  class="radios" type="radio" value="1" name="sell" data-check="{$data.sell}">出租                                	</label>                    </div>
                </div>
                           <div class="form-item cf">
                    <label class="item-label">是否熱買<span class="check-tips"></span></label>
                   <div class="controls">
                        <label>
                                    <input class="radios" type="radio" value="1" name="hots" data-check="{$data.hots}">是                                	</label><label >
                                    <input  class="radios" type="radio" value="0" name="hots" data-check="{$data.hots}">否                                	</label>                    </div>
                </div>       
                 <div class="form-item cf"  style="float: left">
                    <label class="item-label">價格<span class="check-tips">（所有價格自定義單位）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="price" value="{$data.price}" ><input type="text" class="text input-2x" name="unit" value="" >                       </div>
                </div>
                                <div class="form-item cf"  style="float: left">
                    <label class="item-label">預估交易費<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="fee" value="{$data.fee}" >                    </div>
                </div>
                                          <div class="form-item cf">
                    <label class="item-label">總價格<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="houses_prices" value="{$data.houses_prices}" >                    </div>
                </div>
                       <div class="form-item cf" style="float: left">
                    <label class="item-label">首付<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="pay" value="{$data.pay}" >                    </div>
                </div>
                 <div class="form-item cf" >
                    <label class="item-label">面積<span class="check-tips">(單位)</span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="size" value="{$data.size}" > <input type="text" class="text input-2x" name="units" value="" >                    </div>
                </div>
                    <div class="form-item cf" >
                    <label class="item-label">房型<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-2x" name="shi"  value="{$data.shi}">   室  <input type="text" class="text input-2x" name="ting" value="{$data.ting}" >  廳    
                     <input type="text" class="text input-2x" name="wei" value="{$data.wei}" >  衛  <input type="text" class="text input-2x" name="che" value="{$data.che}" > 車庫
                    </div>
               
                    </div>
                    <div class="form-item cf" >
                    <label class="item-label">屬性<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-5x" name="attribute" value="{$data.attribute}" >                    </div>
                </div>
                       <div class="form-item cf" >
                    <label class="item-label">電話<span class="check-tips"></span></label>
                    <div class="controls">
                        <input type="text" class="text input-5x" name="tel"  value="{$data.tel}">                    </div>
                </div>
	<div class="main-title cf">
		<h2>
		其它資料
		</h2>
	</div>   
                          <div class="form-item cf" >
                    <label class="item-label">特色描述<span class="check-tips"></span></label>
                    <div class="controls">
                           <label class="textarea input-large">
                                <textarea name="description">{$data.description}</textarea>
                                </label>     
                    </div>
                </div>
                <div class="form-item cf">
                    <label class="item-label">實景圖<span class="check-tips"></span></label>
                    <div class="controls">

    <div id="upload_picture_photo" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_1" type="application/x-shockwave-flash" data="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430731466033" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430731466033"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_1&amp;uploadURL=%2Fsf%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2F2pieuumh72k3igkgkiruk66av4.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsf%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_photo-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_photo-queue" class="uploadify-queue"></div>
    <input type="hidden" name="photo" value="{$data['photo']}" class="icon photo">
    <div class="upload-img-box">
       <notempty name="data.photo">
        <volist name='photo' id='vo2'>
        <div class="upload-pre-item">
                    <img src="__ROOT__{:get_cover($vo2,$field = path)}" data-id="{$vo2}">
                    <span class="btn-close btn-close-photo" title="删除图片"></span>
                </div>
        </volist>
                   </notempty>
 
    </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
      
        $("#upload_picture_photo").uploadify({
            "height"          : 30,
            "swf"             : "__ROOT__/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "__ROOT__/index.php?s=/Admin/File/uploadPicture/session_id/2pieuumh72k3igkgkiruk66av4.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturephoto,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-photo').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_photo").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo').val(picStr);
        });
})
    function uploadPicturephoto(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sf' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-photo' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_photo").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
               
                <div class="form-item cf">
                    <label class="item-label">外景圖<span class="check-tips"></span></label>
                    <div class="controls">
                        <script type="text/javascript" src="/sf/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sf/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sf/Addons/UploadImages/style/UploadImages.css">
    <div id="upload_picture_photo2" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_2" type="application/x-shockwave-flash" data="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430810486915" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430810486915"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_2&amp;uploadURL=%2Fsf%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2F2pieuumh72k3igkgkiruk66av4.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsf%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_photo2-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_photo2-queue" class="uploadify-queue"></div>
    <input type="hidden" name="photo2" value="{$data.photo2}" class="icon photo2">
    <div class="upload-img-box">
     
        <notempty name="data.photo2">
    <volist name='photo2' id='vo'>
         
        <div class="upload-pre-item">
                    <img src="__ROOT__{:get_cover($vo,$field = path)}" data-id="{$vo}">
                    <span class="btn-close btn-close-photo2" title="删除图片"></span>
                </div>
        </volist> 
        </notempty>

          
            </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
        $("#upload_picture_photo2").uploadify({
            "height"          : 30,
            "swf"             : "__ROOT__/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "__ROOT__/index.php?s=/Admin/File/uploadPicture/session_id/2pieuumh72k3igkgkiruk66av4.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturephoto2,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-photo2').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_photo2").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo2').val(picStr);
        });
})
    function uploadPicturephoto2(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sf' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-photo2' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_photo2").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo2').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
                     <div class="form-item cf" >
                         <label class="item-label">地理位置<span class="check-tips">（填寫坐標）</span></label>
                    <div class="controls">
                        <input type="text" class="text input-4x" name="place" value="{$data.place}" > <a target="_BLANK"  href="http://www.gpsspg.com/maps.htm">獲取坐標</a>                     </div>
                </div>
             
 </div>

		<div class="form-item cf">
			<a class="btn btn-return" id="submit" target-form="form-horizontal">確 定</a>
			<a class="btn btn-return" href="{$Think.cookie.__forward__}">返 回</a>
			<input type="hidden" name="id" value="{$info.id|default=''}"/>
			<input type="hidden" name="pid" value="{$info.pid|default=''}"/>
			<input type="hidden" name="model_id" value="{$info.model_id|default=''}"/>
			<input type="hidden" name="category_id" value="{$info.category_id|default=''}">
		</div>
	</form>
	</div>
</div>
<script type="text/javascript">
        var tag = $.ajax({
               url:"{:U('Tag/index')}",
               async:false,
               success:function(data){
                  $('#tag').html(data);     
               },
               error:function(){
                   alert('錯誤');
               },
           })
        $('.tagmake').click(function(){
          var title= $('.tagtxt').val();
          if(title!='')
          {
            $.ajax({
               url:"{:U('Tag/add')}",
               type:"post",
               data:{title:title},
               async:false,
               success:function(data){
                  $('#tag').html(data);     
               },
               error:function(){
                   alert('錯誤');
               },
           });
          }
        }) ;   
</script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/sf.js"></script>
</block>

<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">

Think.setValue("type", {$data.type|default='""'});
Think.setValue("display", {$data.display|default=0});



$(document).on('click','.shake',function(){
    var title = $(this).html();
       $.ajax({
               url:"{:U('Tag/del')}",
               type:"post",
               data:{title:title},
               async:true,
               success:function(data){
                  alert('刪除成功');
                 $('#tag').html(data);   
               },
               error:function(){
                   alert('錯誤');
               },
           });
});
</script>
</block>
